#!/bin/bash -x

app="--app=";
if [ "x$CHROME_BIN" != "x" ]
then
    if [ -x $CHROME_BIN ]
    then
	browser="$CHROME_BIN";
    fi
else
    chromium=`which chromium`;
    if [ $? -eq 0 ]
    then
	if [ -x $chromium ]
	then
	    browser="$chromium";
	fi
    else
	chrome=`which google-chrome`;
	if [ $? -eq 0 ]
	then
	    if [ -x $chrome ]
	    then
		browser="$chrome";
	    fi
	fi
    fi
fi

if [ "x$browser" == "x" ]
then
    browser="firefox";
    app="";
fi

php -c php.ini -S "localhost:5555" &
$browser "${app}http://localhost:5555" &

